package com.moguhoutai.biz;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.moguhoutai.dao.ModeMapper;
import com.moguhoutai.model.Mode;
import com.moguhoutai.util.BusinessException;

@Service
public class ModeBiz {
    @Resource
	private ModeMapper modeMapperdao;
	
    public Mode findById(int modeId)throws BusinessException{
    	try {
			return modeMapperdao.selectByPrimaryKey(modeId);
		} catch (Exception e) {
			e.printStackTrace();
			throw new BusinessException("E08B04");
		}
    	
    }
    
    public void save(Mode mode)throws BusinessException{
    	try {
			 modeMapperdao.insert(mode);
		} catch (Exception e) {
			e.printStackTrace();
			throw new BusinessException("E08B01");
		}
    	
    }
    
}
